package com.artezio.testapp.service;
 
import java.util.List;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.artezio.testapp.dao.CityDAO;
import com.artezio.testapp.domain.City;
 
 
@Service
public class CityServiceImpl implements CityService {
 
    @Autowired
    private CityDAO cityDAO;
	
    @Transactional
    public void addCity(City city) {
    	cityDAO.addCity(city);
    }
    
    @Transactional
    public List<City> listCity() {
    	return cityDAO.listCity();
    }
    
    @Transactional
    public City getCity(Integer id) {
    	return cityDAO.getCity(id);
    }
    
    @Transactional
    public void removeCity(Integer id) {
    	cityDAO.removeCity(id);
    }
    
    @Transactional
    public int getCount(){
    	return cityDAO.getCount();
    }
    
    @Transactional
    public int getFilteredCount(String filterString){
    	return cityDAO.getFilteredCount(filterString);
    }
}
